﻿<#
.DESCRIPTION
	TODO
#>

param
(
	$Path = $(throw "You need to provide an input path."),
	$CacheFileName = "Cache.txt"
)

# does not use the default @() lists from PowerShell as those are very slow
$Cache = New-Object "System.Collections.Generic.List[string]"

Get-ChildItem -Path $Path | ForEach-Object {
	$Total = 0
} {
	$FileName = $_.Name
	$Cache.Add($FileName)

	$Total++

	if ($Total % 10000 -eq 0) {
		Write-Debug "Added another 10K files to cache."
	}
} {
	Write-Host "Added $Total files to cache."
}

$Cache | Out-File -Encoding Ascii -FilePath $CacheFileName
